import { createRouter, createWebHistory } from 'vue-router'



const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {path: '/',redirect: 'manager/home'},
    {path:'/manager',name:'manager',component:()=>import("../views/Manager.vue"),children:[
        {path:'/manager/data',name:'data',meta:{title:"数据展示页"},component:()=>import("../views/Data.vue")},
          {path:'/manager/home',name:'home',meta:{title:"首页"},component:()=>import("../views/Home.vue")},
      ]}
  ],

})
router.beforeEach((to,from,next)=>{
  document.title=to.meta.title
  next()
})

export default router
